# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=hoel
pkgver=1.4.29
pkgrel=1
pkgdesc='C Database abstraction library with json based language'
arch=(loong64 x86_64)
url=https://github.com/babelouest/hoel
license=(LGPL2.1)
depends=(
  glibc
  jansson
  liborcania.so
  libyder.so
)
makedepends=(
  cmake
  doxygen
  git
  graphviz
  mariadb-libs
  ninja
  postgresql-libs
  sqlite
)
optdepends=(
  'postgresql-libs: PostgreSQL support'
  'mariadb-libs: MariaDB support'
  'sqlite: SQLite support'
)
provides=(libhoel.so)
_tag=33598d2c8defc4eeff208249b5bed67c7ed62e48
source=(git+https://github.com/babelouest/hoel.git#tag=${_tag})
validpgpkeys=(8405B02FCC28EF9744C8F253FE82139440BD22B9) # Nicolas Mora <nicolas@babelouest.org>
b2sums=(SKIP)

pkgver() {
  cd hoel
  git describe --tags | sed 's/^v//'
}

build() {
  cmake -S hoel -B build -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DBUILD_HOEL_DOCUMENTATION=ON
  ninja -C build doc
}

package() {
  DESTDIR="${pkgdir}" ninja -C build install
  install -dm 755 "${pkgdir}"/usr/share/doc/hoel
  cp -dr --no-preserve=ownership hoel/doc/html "${pkgdir}"/usr/share/doc/hoel/
}

# vim: ts=2 sw=2 et:
